package lyn;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lyn
 * Date: 2025-01-19
 * Time: 11:00
 */
class text{
    public void fun(){
        System.out.println("打印父类的成员方法");
    }
}
class text2 extends text{
  public void fun(){
        System.out.println("打印子类的成员方法");
        super.fun();
    }
}
public class text1 {
    public static void main(String[] args) {
        text2 Text = new text2();
        Text.fun();
    }
}
//轮胎类
class Tire{
    /////
}
//发动机类
class Engine{
    ////
}
class Car{
    private Tire tire;//可以复用轮胎中的属性和方法
    private Engine engine;//可以复用发动机中的属性和方法
}
//奔驰是汽车
class Benz extends Car{
    //将汽车中包含的轮胎，发动机等全部继承下来
}

